package com.meilai.project.dto.business.contract;

import com.meilai.project.entity.business.contract.ContractMediaDetail;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import java.math.BigDecimal;

/**
 * @author xchen
 * @since 2022-04-13
 */
@Data
@ApiModel
@Validated
public class MediaDetailReq {

    @ApiModelProperty(value = "媒体类型Id")
    private Integer media_type_id;

    @ApiModelProperty(value = "媒体规格Id(字符串)")
    private String media_type_spec_id;

    @ApiModelProperty(value = "数量")
    private Integer quantity;

    @ApiModelProperty(value = "时长")
    private String duration;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    public ContractMediaDetail toPO() {
        ContractMediaDetail contractMediaDetail = new ContractMediaDetail();
        contractMediaDetail.setMedia_type_id(this.getMedia_type_id());
        contractMediaDetail.setMedia_type_spec_id(this.getMedia_type_spec_id());
        contractMediaDetail.setQuantity(this.getQuantity());
        contractMediaDetail.setDuration(this.getDuration());
        contractMediaDetail.setAmount(this.getAmount());
        contractMediaDetail.setPrice(this.getPrice());
        return contractMediaDetail;
    }
}
